import request from '@/utils/request'
export default {
    //分页条件查询分类列表
    getList(query, current = 1, size = 20) {
        return request({
            url: `/article/category/search`,
            method: 'post',
            data: {
                ...query,
                current,
                size
            }
        })
    },
    add(data) {
        return request({
            url: `/article/category`,
            method: 'post',
            data: data
        })
    },
    // 通过id查询类别
    getById(id) {
        return request({
            url: `/article/category/${id}`,
            method: 'get'
        })
    },
    // 提交
    update(data) {
        return request({
            url: `/article/category/`,
            method: 'put',
            data
        })
    },
    //删除
    deleteById(id) {
        return request({
            url: `/article/category/${id}`,
            method: 'delete'
        })
    },
}